﻿Public Class Pelates
    Private idEt As String

    Private Sub PelatesBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PelatesBindingNavigatorSaveItem.Click
        If (OnomaTextBox.Text = "") Then
            Me.ErrorProvider1.SetError(OnomaTextBox, "Πρέπει να δώσεις όνομα πελάτη")
        Else
            Me.Validate()
            Me.PelatesBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.PanalogDataSet)
        End If
    End Sub

    Private Sub Pelates_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'PanalogDataSet.Poliseis' table. You can move, or remove it, as needed.
        Me.PoliseisTableAdapter.Fill(Me.PanalogDataSet.Poliseis)
        'TODO: This line of code loads data into the 'PanalogDataSet.Efories' table. You can move, or remove it, as needed.
        Me.EforiesTableAdapter.Fill(Me.PanalogDataSet.Efories)
        'TODO: This line of code loads data into the 'PanalogDataSet.Pelates' table. You can move, or remove it, as needed.
        Me.PelatesTableAdapter.FillPelates(Me.PanalogDataSet.Pelates, idEt)
        If (OnomaTextBox.Text = "") Then
            Button1.Enabled = False
        End If
    End Sub

    Public Sub gemisma(ByRef id)
        idEt = id
    End Sub

    Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click
        If Not (My.Computer.Keyboard.NumLock) And My.Computer.Keyboard.CapsLock Then
            MsgBox("Προσοχή το Num Lock είναι απενεργοποιημένο και το Caps Lock ενεργοποιημένο.")
        ElseIf Not My.Computer.Keyboard.NumLock Then
            MsgBox("Προσοχή το Num Lock είναι απενεργοποιημένο.")
        ElseIf My.Computer.Keyboard.CapsLock Then
            MsgBox("Προσοχή το Caps Lock είναι ενεργοποιημένο.")
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        GroupBox1.Visible = True
        Me.PoliseisTableAdapter.FillPoliseis(Me.PanalogDataSet.Poliseis, IDTextBox.Text)
    End Sub
End Class
